6. processing and sorting machine modular approach 3
好的,继续,我们只需要添加一个简单的修正,实际上对于模拟的构建方式,这种情况永远不会发生。
OK, so moving on, we just need to add a simple correction that actually for how the simulation is built, this condition will never happen.
但在真实的机器中,这是有道理的。
But in a real machine, this makes sense.
嗯,在我们的提取站,嗯,当我们这里有产品时,我们正在向前推进产品。
Um, here in our extraction station, um, we are moving the product forward when we have a product here.
我们还应确保液位以下没有产品,因此这里正确的说法可能是,如果我们在活塞启动传感器上有产品,而我们手上没有产品。
We shall also make sure that there is no product beneath the level, so here a correct statement could be that if we have a product here on the piston start sensor and we do not have a product on the hand.
所以这款产品适合我们的皮卡。
So on this product for our pickup.
因此,如果出于某种原因,这里有一个产品,并且这里有一个产品,那么活塞将不会开始移动,直到这个产品,这个产品消失。
So in this way, if for any reason there is a product here and the product here, the piston won't start moving until this product, this one disappears.
好的。
OK.
现在让我们前往第二站。
Now let's move on to the second station.
这就是这里的水平。
That is the level here.
我们实际上可以复制并粘贴一些我们已经编写的代码。
We can actually copy and paste some of the code that we already wrote.
因此,让我们首先复制我们稍后需要使用的水平站的局部变量。
So let's start by copying the local variables for our, um, level station that we will need to use shortly.
让我们也构建我们的案例。
And let's build our case as well.
那么让我们重新开始吧。
So let's start again.
案例状态关闭。
Case state off.
所以现在我就在右边这里打开建设站。
So for now, I will open the construction station here on the right.
所以我们的禁用状态实际上可以复制大部分代码。
So our disabled state can actually be copied for most of the code.
嗯,我们设定在这里,比方说,你实际使用的大约 10 年左右,继续使用这个词,我们只删除这五年,现在大约是四年。
Um, we were set here, let's say, the 10 year or so for you to actually use keep using the word that we're only removing this five, about four for now.
我不会这样做。
I will not do this.
所以我将删除这个对实际的调用。
So I will remove this call to the actual.
嗯,对于助长邪恶的产品,因为这不是给我们气象站的礼物,同样在这里,如果我们收到紧急情况的开始而不是停止,我们就不能转移到另一个州。
Um, to the products in feeding the evil, because this is not a present for our weather station and in the same way here, if we received the start and not the stopping of the emergency, not all we can move to another state.
所以。
So.
我们在这里需要做的是以与处理五号州际公路相同的方式转向撤离站。
What we need to do here is to turn in the same way that we handle the Interstate five for the extraction station.
我们需要管理空间站的归航程序。
We need to manage the homing procedure of the station.
因此,我们需要确保杠杆位于左侧,并且我们的夹具没有抓取任何产品。
So we need to make sure that the lever is on the left and that our gripper is is not grabbing any product.
所以在这里我们可以将右侧的控制杆向左移动。
So here we could the right move lever left.
在这里,我们可以设置更右侧的驱动,以强制开始向左移动杠杆以及杠杆夹具,我们也可以将其设置为 false。
Here we can set the actuation that was more a right to force to start moving the lever to the left and also the lever gripper, we can set it to false as well.
我们需要保持该状态直到到达左侧位置。
We need to remain in the state until we reach the left position.
因此,如果。
So if.
我们已经将位置传感器留在那里,我们可以移动到另一个状态 status 等于 20,OK。
We have ever left the position sensor there, we can move to another state status equal to 20, OK.
现在,我们实际上不能等待产品。
Here right now, we cannot actually wait for a product.
因此,等待产品,在状态 20 中,我们可以纠正这一点。
So wait for product and in state 20, we can right that.
如果我们的产品今年永远受欢迎,那么我们需要将该产品移到电梯上,这样我们就可以跳到另一个州的国家机构。
If our product for ever pick up for product this year, then we need to move this product onto the elevator so we will jump to another state state authority.
但这并不是我们需要研究的唯一条件。
But this is not the only condition that we need to look into.
我们需要实际检查一些其他条件,这样我们实际上就无法移动杠杆。
We need to actually check a few other conditions so we actually cannot afford to move the lever.
正确的。
Right.
如果升降机上已经有产品或者升降机未处于正确位置。
If there is already a product on the elevator or if the elevator is not in the correct position.
所以我们可以在这里骑行。
So here we can ride.
如果没有,很抱歉,如果存在不可取货的产品,并且我们电梯上没有产品,所以。
If not, sorry if the product for no pickup is present and we do not have a product on the elevator, so.
而不是电梯上的产品。
And not the product on elevator and.
我们需要电梯在底部和电梯按钮传感器,如果我们具备这三个条件,那么我们就可以。
We need the elevator to be at the bottom and elevator button sensor, if we have all of these three conditions, then we can.
向右移动。
Move to the right.
因此,在状态 30 中,我们可以做的是,启用夹具,以便控制水平夹具以抓取水平面下方的产品。
So here in state 30, what we can do is, yes, enable the griper so level grippers should be controlled to grab the product that is beneath the level.
我们将开始向右移动,向右等于真实。
And we shall start moving right level, right equal to true.
我们将这样做,直到达到我们的水平。
And we shall do this until we get to our level.
正确的位置传感器。
Right position senser.
当我们有权占据这个位置时,我们就可以开始向后移动。
When we have a right to this position, we can start moving back.
好吧,我会纠正这个,嗯,向右移动控制杆。
Well, I will right this, um, move lever right.
启用 Ripper 后,当我们到达右侧水平位置时,我们可以开始向左移动。
With Ripper enabled when we have reached the level right position, we can start moving left.
但我们实际上已经有了一个状态,在这个状态下,我们在禁用夹具的情况下向左移动。
But we actually already have a state and when in which we are moving left with the gripper disabled.
所以我们实际上会使用它,这样我们就可以简单地编写。
So we will actually use this so we can simply write.
state 应等于 10。
The state should become equal to 10.
这主要是关于杠杆站主循环的内容。
And this is mostly it for what concerns the main cycle of the lever station.
让我们回到这里的提取站,我们实际上可以复制所有这些。
Let's get back into the extraction station here and we can actually copy all of this.
我们来复制一下整个实施紧急停车等等。
Let's copy the whole implementation emergency stop and so on.
然后我们来看看这个。
And then let's look into this.
所以这里的解封就是从这里开始的。
So here uncapping is starting from here.
所以我会删除这部分并粘贴。
So I would remove this part and paste.
因此,让我们看看我们需要查看什么,当然我们需要编辑此停止状态和此紧急情况,当然,如果我们收到紧急请求或我们需要的话。
So let's see what we need to look at it, surely we need to edit this stopping state and this emergency condition, surely if we are receiving an emergency request or we need to.
从禁用级别开始,这样杠杆撕裂者应该变为假,因为我们正在释放所有产品,然后是杠杆和移动杠杆。
Start with disable the level so the lever ripper should become false because we are releasing all the products and then the lever and the move lever.
对,也应该变成假的。
Right, should become false as well.
好的。
OK.
然后,对于停止状态,这意味着我们按下按钮并且向左或向右移动,我们可以做一些类似于我们为人所做的事情,这样我们就可以管理水平仪的移动。
Then for what concerns the stopping state, that means that we are pressing the button and the was either moving left or right, we can do something similar to what we did for the person so we can manage the movement of the level.
直到我们到达最终位置,所以如果我们向前移动,我们会等到处于向前位置,如果我们向后移动,我们将等待处于向后位置。
Until we reached a final position, so if we were moving forward, we wait until we are in the forward position and if we're moving backward, we will wait to be in the backward position.
因此,如果我们向左、向右移动控制杆,如果我们向左移动,我们将等待水平右位置句子。
So if we had moved the lever left, right through, we will wait for the level right position sentencer if instead we are moving left.
所以我们没有移动杠杆。
So we have not moved a lever.
正确的。
Right.
我们将等待操纵杆左侧位置传感器。
We will wait for the lever left position sensor.
无论如何,当我们到达该位置时,我们可以释放假的夹具,我们应该可以开始了。
In any case, when we reach the position, we can release the gripper ever become false and we should be good to go.
好的。
OK.
我想我们的杠杆站已经完成了。
I guess that our lever station is done.
让我们打开可视化并上网。
Let's open the visualisations and go online.
我也会在这里保持车站凉爽,以便看到车站状态的价值。
I will also keep the station cool here in order to see the value of the station state.
让我们上网下载,看看按开始我们是否成功获得了产品。
Let's go online with the download and see if by pressing start we managed to get a product.
到电梯。
To the elevator.
普雷斯塔,让我们从这里开始吧。
Presta, let's start here.
好的,活塞正在移动。
OK, the piston is moving.
肝脏正在工作,与第一个问题的不同之处在于。
And liver is working, and the difference to the first problem is that.
我们的活塞应该将另一种产品移到那里。
Our piston's should move another product there.
现在我们正在等待,因为 Beston 正在等待该产品消失并等待任何人出现,而情人正在等待电梯来处理该产品。
And now we are holding because the Beston is waiting for this product to disappear and for anyone to appear and the lover is waiting for the elevator to process the product.
因此,让我们按下停止键,然后重新开始测试,比如说,现在就按住,因为我们实际上有两个站,我们可以评估该程序的工作原理。
So let's press a stop and start again to test, let's say, and hold right now, because we have something we have actually two stations and we can evaluate how the procedure works.
我们可以看到station的整个站状态正在发生变化。
We you can see that the whole station state of station is changing.
让我们释放旧的。
Let's release the old.
正如你所看到的。
And as you can see.
一切。
Everything.
我们从它顶部的地方开始。
We're starting from where it was topped.
好的。
OK.
让我们再次停下来,然后开始吧。
Let's stop again and let's start.
因此,让我们尝试将控制杆停在中间位置,现在就停止。
So let's try to stop in the middle position for the lever, let's stop right now.
正如你所看到的,肝脏停在那里。
As you can see, the liver stop there.
因此,如果重新开始,产品被移除,肝脏就会恢复。
So if a start again and the products are removed and the liver is brought back.
好吧,让我们最后一次停下来。
OK, let's stop and for the last time.
让我们从紧急投掷紧急情况开始。
Let's start with an emergency throwing emergency.
紧急情况。
Emergency.
有效。
It worked.
我们发布了所有内容,好吧,所以我们有两个站在工作,第二天我们就会看到电梯。
We released everything, OK, so we have two stations working, and the next day we will see the elevator.